<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>getstyle</title>
</head>
<body>
	<script>
		function getStyle (elem,prop) {
			if(window.getComputedStyle) {
				return window.getComputedStyle(elem,null)[prop];
			}else {
				return elem.currentStyle[prop];
			}
		}
		// 获取元素的CSS属性
		// 
		var div = document.getElementsByTagName('div')[0];
		window.getComputedStyle(div,"after")
		// 获取伪元素;
	</script>
</body>
</html>